package com.jinglvhuanjing.app.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.jinglvhuanjing.app.MainActivity;
import com.jinglvhuanjing.app.utils.LOG;


public class SwitchSystemReceiver extends BroadcastReceiver {

	private String TAG = "SwitchSystemReceiver";
	private Context context;

	@Override
	public void onReceive(Context context, Intent intent) {
		String action = intent.getAction();
		this.context = context;
		LOG.e(TAG, "action:"+action);
		if("android.intent.action.BOOT_COMPLETED".equals(action)){
			LOG.e(TAG, "手机开机");
			Intent  in = new Intent(context, MainActivity.class);
			in.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			context.startActivity(in);
		}
	}

}
